package edu.ecu.seng6270.goa.ropa;

import java.awt.Color;
import java.awt.Font;

import javax.swing.*;

import net.miginfocom.swing.MigLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

/**
 * GUI Panel to inform user of existing order.
 */
public class ExistingOrderPanel extends JPanel {

	ROPAMain parent;
	
	private static final long serialVersionUID = -2335098498729452402L;

	ExistingOrderPanel(final ROPAMain parent) {
		super();
		this.parent = parent;

		this.setBackground(new Color(255, 255, 255));
		this.setLayout(new MigLayout("", "[grow]", "[grow][][][][]"));

		JLabel lblCustomOrder = new JLabel("Your previous order is being processed!");
		lblCustomOrder.setFont(new Font("Tahoma", Font.BOLD, 18));
		this.add(lblCustomOrder, "cell 0 0,alignx center");
		
		JButton btnLoginWithA = new JButton("Login with a Different Customer ID");
		btnLoginWithA.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				parent.moveToCard("loginPanel");
			}
		});
		add(btnLoginWithA, "cell 0 1,alignx center");

	}
}
